package cn.whitecao.sb.test.controller;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.xml.transform.Result;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;

@RequestMapping("/dingding")
@RestController
public class DingDingController {
    @RequestMapping("/message")
    public String message(@RequestBody DingDingRequest dingDingRequest){
        SimpleDateFormat format = new SimpleDateFormat("HH");
        String s = format.format(new Date());
        System.out.println(dingDingRequest==null);
        System.out.println(JSONObject.toJSONString(dingDingRequest));
        return "{\n" +
                "     \"msgtype\": \"text\",\n" +
                "     \"text\": {\n" +
                "         \"content\": \"" +

                "沙比 "

                +
                "\"\n" +
                "     },\n" +
                "     \"at\": {\n" +
                "         \"atMobiles\": [\n" +
                "             \"18324496190\"\n" +
                "         ], \n" +
                "         \"isAtAll\": false\n" +
                "     }\n" +
                " }";
    }


}
